package top.yuyufeng.sample;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import top.yuyufeng.sample.interceptor.AuthorityInterceptor;

/**
 * @author yuyufeng
 * @date 2018/4/19.
 */
@SpringBootApplication
@EnableRedisHttpSession(maxInactiveIntervalInSeconds= 360) //maxInactiveIntervalInSeconds为SpringSession的过期时间（单位：秒）
public class Application extends WebMvcConfigurerAdapter {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new AuthorityInterceptor());
    }
}
